import { useComputed } from './useComputed';
export function useCourseLabel() {
	const { t } = useI18n();
	function courseTypeLabel(type: Number | null) {
		switch (type) {
			case 1:
				return t('courseDetail.typeGroup');
			case 2:
				return t('courseDetail.typePrivate');
			case 3:
				return t('courseDetail.typeTrial');
			case 4:
				return t('courseDetail.typeTemporary');
			case 5:
				return t('courseDetail.typePackage');
			default:
				return '';
		}
	}

	const computeCourseTypeLabel = useComputed(courseTypeLabel);

	function scheduleTypeLabel(type: Number | null) {
		switch (type) {
			case 1:
				return '固定课时';
			case 2:
				return '课时套餐';
			default:
				return '';
		}
	}

	const computeScheduleTypeLabel = useComputed(scheduleTypeLabel);

	function packageTypeLavel(type: Number | null) {
		switch (type) {
			case 0:
				return '1对1';
			case 1:
				return '1对多';
			default:
				return '';
		}
	}

	const computePackageTypeLavel = useComputed(packageTypeLavel);

	return {
		computeCourseTypeLabel,
		courseTypeLabel,
		computeScheduleTypeLabel,
		scheduleTypeLabel,
		computePackageTypeLavel,
		packageTypeLavel,
	};
}
